GetCompressedImageSize
TheGetCompressedImageSize
function determines the size, in bytes, of a compressed image.Most applications do not need to use this function because compressed images have a corresponding image description structure with a size field. You only need to use this function if you do not have an image description structure associated with your data--for example, when you are taking a compressed image out of a movie one frame at a time.
pascal OSErr GetCompressedImageSize (ImageDescriptionHandle desc, Ptr data, long bufferSize, DataProcRecordPtr dataProc, long *dataSize);
desc
- Specifies a handle to the image description structure that defines the compressed image for the operation.
data
- Points to the compressed image data. This pointer must contain a 32-bit clean address.
bufferSize
- Specifies the size of the buffer to be used by the data-loading
function specified by thedataProc
parameter. If you have not specified a data-loading function, set this parameter to 0.dataProc
- Points to a data-loading function structure. If the data stream is not all in memory when your program calls
GetCompressedImageSize
, the compressor calls a function you provide that loads more compressed data (see "Data-Loading Functions" beginning on page 3-153 for more information about data-loading functions). If you have not provided a data-loading function, set this parameter tonil
. In this case, the entire image must be in memory at the location specified by thedata
parameter.dataSize
- Contains a pointer to a field that is to receive the size, in bytes, of the compressed image.
DESCRIPTION
Your application may use theGetCompressedImageSize
function when parsing a data stream that does not contain an image description structure for each frame in the sequence.RESULT CODES
Component Manager errors
noErr 0 No error paramErr -50 Invalid parameter specified noCodecErr -8961 Image Compression Manager could not find the specified compressor codecSpoolErr -8966 Error loading or unloading data